{	Problem: http://codechef.com/problems/DCE05/
 	Verdict: Accepted
}
var i,n:longint; r,k:int64;
begin
read(N);
for i:=1 to n do begin
  read(k);
  r:=1;
  while k<>1 do begin
    r:=r*2;
    k:=k div 2;
  end;
  writeln(r);
end;
end. 